package com.wangc.study.functionref;

import java.util.function.Supplier;

/**
 * @author wangC
 * @create 2020-05-19 下午11:06
 * 方法的引用--实例方法的调用
 **/
public class FountionRefTest2 {


    public static void main(String[] args) {
        //实例方法的引用
        System.out.println(new FountionRefTest2().put());
        //
        Supplier<String> s1 = () -> new FountionRefTest2().put();
        Supplier<String> s2 = () -> { return new FountionRefTest2().put();};
        Supplier<String> s3 = new FountionRefTest2()::put;
        System.out.println(s1.get());
        System.out.println(s2.get());
        System.out.println(s3.get());


    }

    public String put() {
        return "put....";
    }
}
